package com.ra.landlord;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.ra.system.Version;

/**
 * 费用计算公式
 * 
 * @author Jerry.Feng Date: 2014-07-31
 */
@Entity
@Table(name = "ra_feerulecfgcalc")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class FeeRuleCfgCalc implements Version, LandlordOwner {
	
	public static final Integer RENT_CYCLE_TYPE_MONTH = 0;
	
	public static final Integer RENT_CYCLE_TYPE_DAY = 1;
	
	private Integer id;
	
	// 阶梯计算时使用
	private Integer type;
	
	// 对应界面的备注
	
	private String description;
	// 单价， 比方管理费20元每月
	private BigDecimal price;
	
	// 门限的最高消费 （暂未用）
	private BigDecimal valueHigh;
	
	// 门限的最低的消费
	private BigDecimal valueLow;
	
	// 出租周期类型：0 - 月， 1 - 日 (暂未用)
	private Integer rentCycleType;
	
	// 出租周期， 月, 1, 2, 3, 4等
	private Integer rentCycle;
	
	private LandlordOwnerUser landlordUser;
	
	private Integer version;
	
	private Integer status;
	
	@Id
	@GeneratedValue
	@Column(name = "sytbFeeItemCalcId")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "sytbFeeItemCalctype")
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "Description")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "price")
	public BigDecimal getPrice() {
		return price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	@Column(name = "valuehigh")
	public BigDecimal getValueHigh() {
		return valueHigh;
	}

	public void setValueHigh(BigDecimal valueHigh) {
		this.valueHigh = valueHigh;
	}

	@Column(name = "valuelow")
	public BigDecimal getValueLow() {
		return valueLow;
	}

	public void setValueLow(BigDecimal valueLow) {
		this.valueLow = valueLow;
	}

	@Column(name = "rent_cycle_type")
	public Integer getRentCycleType() {
		return rentCycleType;
	}

	public void setRentCycleType(Integer rentCycleType) {
		this.rentCycleType = rentCycleType;
	}

	@Column(name = "rent_cycle")
	public Integer getRentCycle() {
		return rentCycle;
	}

	public void setRentCycle(Integer rentCycle) {
		this.rentCycle = rentCycle;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "createuserid")
	public LandlordOwnerUser getLandlordUser() {
		return landlordUser;
	}

	public void setLandlordUser(LandlordOwnerUser landlordUser) {
		this.landlordUser = landlordUser;
	}
	
	@Column(name = "version_id")
	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	@Column(name = "data_status")
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}
}
